/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fd;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "fd_roles")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FdRoles.findAll", query = "SELECT f FROM FdRoles f"),
    @NamedQuery(name = "FdRoles.findByRol", query = "SELECT f FROM FdRoles f WHERE f.rol = :rol"),
    @NamedQuery(name = "FdRoles.findByDescripcion", query = "SELECT f FROM FdRoles f WHERE f.descripcion = :descripcion")})
public class FdRoles implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "rol")
    private Integer rol;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(name = "descripcion")
    private String descripcion;

    public FdRoles() {
    }

    public FdRoles(Integer rol) {
        this.rol = rol;
    }

    public FdRoles(Integer rol, String descripcion) {
        this.rol = rol;
        this.descripcion = descripcion;
    }

    public Integer getRol() {
        return rol;
    }

    public void setRol(Integer rol) {
        this.rol = rol;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (rol != null ? rol.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FdRoles)) {
            return false;
        }
        FdRoles other = (FdRoles) object;
        if ((this.rol == null && other.rol != null) || (this.rol != null && !this.rol.equals(other.rol))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fd.FdRoles[ rol=" + rol + " ]";
    }
    
}
